Repository navigation
fix(cli): preserve runtime diagnostic codes in Turn failures - #9136
Conversation
Signed-off-by: LoopX Agent <[email protected]>
…tigravity failover (#9141) Signed-off-by: LoopX Agent <[email protected]>
A failed worker start can finish cleanup after a same-turn retry has selected the adapter. Keep its lifetime tied to the Session and let failed dispatch release its own worker registration. The regression asserts one upstream turn and explicit adapter closure with the Session. Port the fix from 4453e4bdd77486ec14b952f88ca893310b32e26c. (cherry picked from commit 173e42b4f051b885c3a3389e1cad9c5722f7b7dd) Signed-off-by: LoopX Agent <[email protected]>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · Gemini · Google DeepMind · self_reported
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机 / Motivation
调用 loopx turn plan 或 loopx turn run-once 的上层调度控制器、自动化脚本及需要区分失败原因的维护者。修改前,当底层 TypeScript Effect runtime 拒绝或与最新状态冲突(例如返回带 diagnostic_code="goal_stopped" 的 EffectRuntimeConflict)时,Shared Turn 错误载荷构建函数 build_turn_error_payload 仅读取异常的 code 属性,未读取 EffectRuntimeRemoteError.diagnostic_code,导致 CLI 输出 JSON 中丢失机器可读的 error_code,外部调用方只能看见可读报错文本却无法按稳定错误码做分类恢复。修改后,build_turn_error_payload 在异常未显式提供字符串 code 且属于 EffectRuntimeRemoteError 时复用 exc.diagnostic_code 填充 error_code,同时保留既有 code/payload 优先级与原始 Turn 身份及影响观测。
在 loopx turn plan 与 loopx turn run-once 失败路径中,当发生 EffectRuntimeConflict、EffectRuntimeRejected 等 EffectRuntimeRemoteError 异常时,输出 JSON 准确保留结构化 error_code(如 goal_stopped)、保留 resume_turn_key 与 journal_observation,普通异常(如 ValueError("goal_stopped"))不会将纯文本误判为 error_code,带有既有 code/payload 的异常保持原优先级。
边界说明:本 PR 仅处理 Turn CLI 错误展示层的机器诊断码透传,不新增重试策略、不修改 TypeScript runtime 拒绝语义或 FirstPartyHostRuntimeRejected 转换列表,也不扩展到 EffectRuntimeStartupError、turn managed-step 或 Markdown 渲染格式。
改动思路 / Approach
本 PR 在错误渲染边界做了最小且类型安全的修复。直接复用 EffectRuntimeRemoteError.diagnostic_code(与既有的 quota_failure_report.py 处理方式一致),在唯一共享的 Turn 错误出口 build_turn_error_payload 增加 2 行类型化兜底分支,避免在 turn.py 与 turn_run_once.py 多处分散捕获,也不引入异常文本字符串解析。
从控制流看,handle_turn_command(plan 与外层异常兜底)和 execute_turn_run_once(run-once 含 journal_readback 探测)在捕获异常后都会汇入同一个 build_turn_error_payload 函数。此前 FirstPartyHostRuntimeRejected(仅承接 goal_not_registered、goal_authority_unavailable、goal_instance_id_missing、stale_goal_instance 4 种冲突码)和 TurnTodoSelectionError 各自设置了 .code 属性,而直接透传自 effect_runtime 的 EffectRuntimeConflict(例如结果持久化阶段抛出的 goal_stopped)、EffectRuntimeRejected 等 EffectRuntimeRemoteError 子类则将错误码存放在 .diagnostic_code 上。通过在 isinstance(error_code, str) 不成立时检查 isinstance(exc, EffectRuntimeRemoteError),在不改变任何既定 .code/.payload 优先级与普通异常隔离原则的前提下打通了透传路径。当前 PR 边界为 loopx/cli_commands/turn_rendering.py 的 3 行生产修改与 tests/test_loopx_turn_error_readback.py 的 77 行回归测试(含真实 loopx turn run-once CLI 端到端测试),不改动控制面状态机、quota 记账或启动期 EffectRuntimeStartupError 映射。
具体改动 / Changes
关键代码讲解
loopx/cli_commands/turn_rendering.py#L9&#L74-L78(build_turn_error_payload)- 引入
EffectRuntimeRemoteError,在读取error_code = getattr(exc, "code", None)后追加判断:if not isinstance(error_code, str) and isinstance(exc, EffectRuntimeRemoteError): error_code = exc.diagnostic_code。 - 保持既有约束:只有
isinstance(error_code, str)为真时才写入 JSON"error_code",既有异常自带的.code与.payload优先权完全不变;普通异常(如ValueError("goal_stopped"))不会因为报错消息与已知码同名而被臆造为机器错误码。
- 引入
tests/test_loopx_turn_error_readback.py#L90-L166(新增 4 组覆盖,共 5 个测试点)test_runtime_conflict_preserves_machine_diagnostic_without_parsing_message(参数化plan与run-once):验证EffectRuntimeConflict(..., diagnostic_code="goal_stopped")正确输出error_code == "goal_stopped"、原始error、全空effects(execution_started=True时为None)及resume_turn_key。test_generic_error_does_not_invent_a_machine_diagnostic:验证ValueError("goal_stopped")不产生error_code。test_ordinary_turn_cli_keeps_runtime_conflict_after_host_result:通过loopx.cli.main执行完整turn run-once --host codex-cli --execute,在真实_fake_codex产出宿主结果后注入_write_journal阶段EffectRuntimeConflict(..., diagnostic_code="goal_stopped"),验证 CLI 退出码为1、输出保留error_code == "goal_stopped"、resume_turn_key与未消费配额的journal_observation。test_existing_exception_code_and_payload_keep_precedence:验证既有.code与.payload仍优先于.diagnostic_code。
规范情况
经检索 docs/architecture/rfcs/semantic-vocabulary-convergence-v0.md 与 docs/reference/protocols/turn-loop-controller-v0.md,两者分别规范配额动作选择与 managed-step 状态转移,尚无针对 build_turn_error_payload 读取 EffectRuntimeRemoteError.diagnostic_code 的独立书面规范(no_spec);本评审依据现有 turn_rendering.py 与同源 quota_failure_report.py 诊断透传契约完成交付判断。
对主干的风险 / Risks
- 非阻塞观察(低风险):
EffectRuntimeStartupError(例如EffectRuntimeHostPermissionError、EffectRuntimeNodeProbeError、EffectRuntimeResponseAmbiguous)同样定义.diagnostic_code且可到达build_turn_error_payload,本 PR 仅覆盖EffectRuntimeRemoteError(与quota_failure_report.py当前做法一致);此边界在无改动前提下与主干基线保持一致,如有需要可在后续独立扩展,不构成合入阻塞。另注render_loopx_turn_execution_markdown与render_loopx_turn_plan_markdown当前均未渲染error_code(与基线一致,仅面向 JSON 消费方)。 - 语义与控制流边界:不新增或扩展任何控制面全局枚举/词表(
goal_stopped等由运行时已有定义发出),不改变FirstPartyHostRuntimeRejected、重试/停止策略或配额语义;域无关性(domain_neutrality)与强制/建议区分(guidance_vs_obligation)均未受影响。 - 生产调用链确认(
scope_fit):build_turn_error_payload在loopx/cli_commands/turn.py#L494与loopx/cli_commands/turn_run_once.py#L844被生产路径直接调用。 - 本地验证矩阵(Exact Head
bacfc4cfc916e7774c01b5749dff3e8bf4cc939e):uv run --extra test pytest tests/test_loopx_turn_error_readback.py -v:PASS(10 passed / 0 failed,含新增 5 个用例;并核对基线eb552a8bb0的turn_rendering.py不含EffectRuntimeRemoteError分支)。uv run --extra test pytest tests/test_loopx_turn_error_readback.py tests/test_loopx_turn_codex_cli.py tests/test_loopx_turn_driver.py -q:PASS(328 passed / 0 failed)。uv run --extra test ruff check loopx/cli_commands/turn_rendering.py tests/test_loopx_turn_error_readback.py:PASS(All checks passed!)。uv run --extra test mypy:PASS(17 个配置目标文件无错误)。uv run --extra test loopx check --scan-path ...:PASS(errors=0, warnings=0, public boundary scan clean)。uv run --extra test loopx canary premerge --from-git-diff --git-diff-base origin/main --tier quick:PASS(4 项 direct checks、py_compile 与 3 项 catalog canaries 含cli-output-budget-regression-smoke.py全部通过)。
我的整体评价 / Verdict
综合评估,long_horizon 为 improved(调度器与外层循环在运行时拒绝/状态冲突后可依据机器可读 error_code 准确分诊而不是当成未知报错),user_experience 为 improved(JSON 输出保留稳定 error_code 与恢复身份且不混淆普通文本报错)。
关于视觉评估:本次改动仅影响 Python Turn CLI 错误 JSON 载荷(loopx/cli_commands/turn_rendering.py)及其单测,未改动任何前端 UI、Dashboard 页面或视觉布局。 unverified_scope: none。
代码体量高度克制(2 个文件 +80/-0,生产代码仅 +3/-0),直接复用已有 EffectRuntimeRemoteError.diagnostic_code 与共享渲染出口 build_turn_error_payload,未新增任何抽象、分支配置或全局词表,保留全部既有 .code/.payload 兼容优先级。在精确提交 bacfc4cfc916e7774c01b5749dff3e8bf4cc939e 上所有本地测试与 premerge 门禁均已通过,建议批准。
English verdict: APPROVE — exact head bacfc4c has no blocking findings; 328/328 Turn CLI/driver/error-readback tests, ruff, mypy, boundary scan, and quick premerge canaries all passed.
…#9143) Signed-off-by: LoopX Agent <[email protected]>
…n conversation_scope (#9145) Signed-off-by: LoopX Agent <[email protected]>
* test(quota): verify scoped gates through complete lane references Signed-off-by: LoopX Agent <[email protected]> * Test canonical quota gates in both public response modes Signed-off-by: LoopX Agent <[email protected]> --------- Signed-off-by: LoopX Agent <[email protected]>
* Use recorded quota decisions in the no-Todo settlement regression Signed-off-by: LoopX Agent <[email protected]> * Exercise the complete Host prompt from the captured quota source Signed-off-by: LoopX Agent <[email protected]> --------- Signed-off-by: LoopX Agent <[email protected]>
Signed-off-by: LoopX Agent <[email protected]>
Signed-off-by: LoopX Agent <[email protected]>
* Link long thin-claim overlap lists to their receipts Signed-off-by: LoopX Agent <[email protected]> * Read claim overlap details without copying the lease Signed-off-by: LoopX Agent <[email protected]> --------- Signed-off-by: LoopX Agent <[email protected]>
Carry Todo selection provenance into quota admission. Preserve explicit secondary Monitor polling and recovery from previously admitted receipts. Signed-off-by: LoopX Agent <[email protected]>
Signed-off-by: LoopX Agent <[email protected]>
* refactor(core): defer benchmark implementations during capability discovery Preserve the benchmark toolkit public exports and static types while keeping execution and experiment implementations out of metadata discovery. Qualify source and installed Core paths, and reconcile the paired minimal/Standard RFC boundary without changing activation or authority defaults. Signed-off-by: cicolord <[email protected]> * Defer Yardstick evaluation until an enabled Explore read Signed-off-by: cicolord <[email protected]> * Omit empty Todo summary lanes from ordinary Worker context Signed-off-by: cicolord <[email protected]> * fix(update): honor configured archive directories during rollback Signed-off-by: LoopX Agent <[email protected]> * fix(lark): replay recall guard on current main Signed-off-by: huangruiteng <[email protected]> * docs: record the verified LoopX 2.3.0 release baseline Signed-off-by: LoopX Agent <[email protected]> * Preserve quota spend source when prepared work is admitted Signed-off-by: LoopX Agent <[email protected]> * test(quota): qualify native saved complete-Turn checkpoints Signed-off-by: LoopX Agent <[email protected]> * Retry cleanup of an owned file mutation marker Signed-off-by: LoopX Agent <[email protected]> * Keep synthetic Git-path test data outside the public source scan Signed-off-by: LoopX Agent <[email protected]> * fix(quota): share native preparation wait with readiness Signed-off-by: LoopX Agent <[email protected]> * fix(doctor): bind package update readback to its Python environment Signed-off-by: LoopX Agent <[email protected]> * Keep Doctor discovery separate from service activation Signed-off-by: LoopX Agent <[email protected]> * Verify the recorded Python launcher before Doctor probes it Signed-off-by: LoopX Agent <[email protected]> * fix(desktop): require runtime qualification for macOS preview updates Signed-off-by: LoopX Agent <[email protected]> * fix(quota): reuse replan projection owners during recovery Signed-off-by: LoopX Agent <[email protected]> * Qualify Codex 0.169 native context replay on main Signed-off-by: LoopX Agent <[email protected]> * Stop regenerating retired quota view aliases Signed-off-by: LoopX Agent <[email protected]> * fix: pin deferred native context reads to the original capture Signed-off-by: LoopX Agent <[email protected]> * Keep native capture navigation within small output budgets Signed-off-by: LoopX Agent <[email protected]> * Retire legacy heartbeat work prompt generation Signed-off-by: LoopX Agent <[email protected]> * Capture C1 composition failures as receipt diagnostics Signed-off-by: LoopX Agent <[email protected]> * Recover interrupted native Todo readiness from the original Turn Signed-off-by: LoopX Agent <[email protected]> * Revalidate the original lease before publishing resumed native context Signed-off-by: LoopX Agent <[email protected]> * Fence native readiness publication with the canonical lease writer Signed-off-by: LoopX Agent <[email protected]> * fix(scheduler): keep Codex fallback on the original C1 runtime Signed-off-by: LoopX Agent <[email protected]> * fix(scheduler): pin the originating fallback launchers Signed-off-by: LoopX Agent <[email protected]> * Retire the duplicate Codex App scheduler projection Signed-off-by: LoopX Agent <[email protected]> * Seed the recorded scheduler profile in the elapsed-backoff fixture Signed-off-by: LoopX Agent <[email protected]> * Verify canonical cadence on refused and settled Turns Signed-off-by: LoopX Agent <[email protected]> * Pin named Core commands in saved scheduler fallbacks Signed-off-by: LoopX Agent <[email protected]> * fix(research): preserve saved case addresses when a version cannot open Signed-off-by: LoopX Agent <[email protected]> * Preserve citation focus after a saved study refresh Signed-off-by: LoopX Agent <[email protected]> * Capture authenticated LoopX receipts for Research attention (#8790) * feat(research): capture authenticated LoopX attention receipts Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]> * fix(research): tighten attention receipt provenance Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]> * fix(research): publish attention captures after source validation Signed-off-by: huangruiteng <[email protected]> --------- Signed-off-by: lusendong.6789 <[email protected]> Signed-off-by: huangruiteng <[email protected]> Co-authored-by: TRAE CLI <[email protected]> Co-authored-by: huangruiteng <[email protected]> * Recover the original Session and Turn from a confirmed Chat task Signed-off-by: huangruiteng <[email protected]> * perf(lark,native_chat): eliminate redundant full-directory JSON reparsing in steward chat loops (#9041) * perf(lark,native_chat): avoid full directory reparsing in steward chat loops - Make LarkOwnerAttention._route iterate capture candidates lazily so matching stops at the newest valid p2p capture. - Reuse FileChatDiscovery in PrivateIngressObserver._records while preserving strict field validation and fail-closed errors. - Reuse FileChatDiscovery in ChatExternalConversations.pending so unchanged request journals skip redundant JSON reads and stay mutation-isolated. - Add regression and scan-efficiency tests in tests/test_lark_steward_directory_scan_perf.py. Signed-off-by: LoopX Agent <[email protected]> * fix(native-chat): project small recovery metadata fields to stop data_url memory growth Signed-off-by: LoopX Agent <[email protected]> --------- Signed-off-by: LoopX Agent <[email protected]> * Retire transitional smoke checks and duplicate execution (#9073) Signed-off-by: lusendong.6789 <[email protected]> Co-authored-by: TRAE CLI <[email protected]> * feat(steward): support probe-gated generic continuous_monitor todos with handoff and user actions (#9074) Signed-off-by: LoopX Agent <[email protected]> * Remove redundant defensive prose from prompts and comments (#9072) Remove redundant defensive prose while preserving published heartbeat wrappers and externally managed skill readiness. Validated with 197 related tests, independent historical wrapper migrations and negative cases, installed-skill readback, and current-main quick canary. Existing CI qualification and infrastructure limitations remain recorded in PR #9072. Signed-off-by: lusendong.6789 <[email protected]> Signed-off-by: Lusen Dong <[email protected]> * Keep original Chat retry errors visible during receipt refresh Signed-off-by: LoopX Agent <[email protected]> * fix(steward): tolerate report validator python drift and allow cancel of mid-turn failed reports (#9077) Signed-off-by: LoopX Agent <[email protected]> * feat(steward): add exact-head PR review signals and protected merge confirmation (#9081) Signed-off-by: LoopX Agent <[email protected]> * feat(steward): add isolated OpenViking long-term memory with per-speaker boundaries (#9083) Signed-off-by: LoopX Agent <[email protected]> * refactor(content-ops): slim surface module and eliminate Any (#8961) * refactor(content-ops): slim surface module and eliminate Any Signed-off-by: LoopX Agent <[email protected]> * fix(content-ops): reject malformed angle source_item_ids containers Signed-off-by: LoopX Agent <[email protected]> --------- Signed-off-by: LoopX Agent <[email protected]> * fix(collaboration): batch handoff query Goal lifetime guard lock per Goal (#9085) Signed-off-by: LoopX Agent <[email protected]> * fix(hosts): raise managed service startup readiness timeout to 45s (#9087) Signed-off-by: LoopX Agent <[email protected]> * perf(manager-context): memoize history_inspect lifecycle checks and scope runtime revision in handoffs query (#9088) Eliminate the remaining O(N) Effect runtime RPCs and uncached runtime fingerprinting inside tracking.query(): enter effect_runtime_request_scope() for the query, memoize pure history_inspect lifecycle decisions across entries sharing identical Goal refs while holding the Goal lifetime guard, lazily discover legacy ingress files only when external audience recovery needs them, and preserve entry scan order across Goal batches. Signed-off-by: LoopX Agent <[email protected]> * refactor(lark): slim private_conversations below 2000 lines with net LOC reduction (#8929) Signed-off-by: LoopX Agent <[email protected]> * perf(chat,hosts): skip frontend source re-hashing on immutable installed releases and extend readiness timeout to 90s (#9089) Signed-off-by: LoopX Agent <[email protected]> * refactor(control-plane): split and slim quota monitor_poll_commit (#8885) * refactor(control-plane): split and slim quota monitor_poll_commit Signed-off-by: LoopX Agent <[email protected]> * fix(control-plane): preserve legacy lane budget and observation diagnostic order Signed-off-by: LoopX Agent <[email protected]> --------- Signed-off-by: LoopX Agent <[email protected]> * refactor(quota): slim loopx/quota.py and tighten Any count to zero (#8939) Signed-off-by: LoopX Agent <[email protected]> * refactor(native-chat): slim external_conversations below 2k lines and retire ceiling (#8911) * refactor(native-chat): move steward commission mixin to steward_commands and retire external_conversations ceiling Signed-off-by: LoopX Agent <[email protected]> * fix(native-chat): respect include_raw_response in retained result recovery Signed-off-by: LoopX Agent <[email protected]> --------- Signed-off-by: LoopX Agent <[email protected]> * refactor(chat): slim chat_runtime below 1,500 lines, fix entry-point project_contexts guard, and retire ceiling (#8920) * refactor(chat): move session lifecycle mixin to session_open, deduplicate runtime helpers, and retire ceiling Signed-off-by: LoopX Agent <[email protected]> * fix(chat): drop turn_done_events slot before waking waiters on Thread.start failure Signed-off-by: LoopX Agent <[email protected]> --------- Signed-off-by: LoopX Agent <[email protected]> * fix(steward): paginate open PR signal GraphQL, allow signal-unavailable monitor recovery, and cache private delivery scans (#9093) Signed-off-by: LoopX Agent <[email protected]> * perf(lark,native_chat): back off noop recovery retries and cache recovery lookups (#9096) Signed-off-by: LoopX Agent <[email protected]> * perf(native_chat,lark): cache unchanged quota backlog health and interrupt observations (#9098) Signed-off-by: LoopX Agent <[email protected]> * perf(lark,native_chat): coalesce listener snapshots and cache recovery event summaries (#9100) Signed-off-by: LoopX Agent <[email protected]> --------- Signed-off-by: cicolord <[email protected]> Signed-off-by: LoopX Agent <[email protected]> Signed-off-by: huangruiteng <[email protected]> Signed-off-by: lusendong.6789 <[email protected]> Signed-off-by: Lusen Dong <[email protected]> Co-authored-by: cicolord <[email protected]> Co-authored-by: huangruiteng <[email protected]> Co-authored-by: Lusen Dong <[email protected]> Co-authored-by: TRAE CLI <[email protected]>
…slim pr_lifecycle (#8897) Signed-off-by: LoopX Agent <[email protected]>
* fix(codex relay): fence incomplete model requests before drain Signed-off-by: LoopX Agent <[email protected]> * fix(codex relay): surface incomplete upstream responses Port the verified response framing fix to the request-admission branch. Original candidate 27bc3aee311cdfc6a00466ff9d3b58c7db36e01b. Signed-off-by: LoopX Agent <[email protected]> * Bound Codex relay writes to clients that stop reading Signed-off-by: LoopX Agent <[email protected]> * Reject upstream chunked responses missing the trailer terminator Signed-off-by: LoopX Agent <[email protected]> * Validate upstream chunk data delimiters before relay completion Signed-off-by: LoopX Agent <[email protected]> --------- Signed-off-by: LoopX Agent <[email protected]>
…nd release download retry (#9147) Signed-off-by: LoopX Agent <[email protected]>
…-beta.7 README (#9149) Signed-off-by: LoopX Agent <[email protected]>
* fix(chat): recover saved answers and diagnose lost workers Signed-off-by: LoopX Agent <[email protected]> * style(lark): keep private_conversations within module line budget Signed-off-by: LoopX Agent <[email protected]> * fix(chat): retain execution_worker_exited in pending backlog count Signed-off-by: LoopX Agent <[email protected]> --------- Signed-off-by: LoopX Agent <[email protected]>
Signed-off-by: LoopX Agent <[email protected]>
…me tests with C1 defaults (#9151) Signed-off-by: LoopX Agent <[email protected]>
…e, and public smokes (#9152) Signed-off-by: LoopX Agent <[email protected]>
…vent queue kill on observation monitors (#9155) Signed-off-by: LoopX Agent <[email protected]>
…ts for v2.4.0 (#9156) Signed-off-by: LoopX Agent <[email protected]>
…lities slice (Slice B1) (#9154) * fix(control-plane): stabilize v2.4.0 quota, turn-envelope, and capabilities slice Signed-off-by: LoopX Agent <[email protected]> * fix(quota): preserve tokenless identity and exact numeric types in attach_complete_turn_context Signed-off-by: LoopX Agent <[email protected]> --------- Signed-off-by: LoopX Agent <[email protected]>
…med task leases (#9157) Signed-off-by: LoopX Agent <[email protected]>
…and stop receipt-unknown disk churn (#9159) Signed-off-by: LoopX Agent <[email protected]>
…ntime fixtures (#9158) * fix(control_plane): align lease recovery, settlement readback, and runtime fixtures Signed-off-by: LoopX Agent <[email protected]> * fix(control_plane): forward record_capture in worker outage test and harden version type guard Signed-off-by: LoopX Agent <[email protected]> --------- Signed-off-by: LoopX Agent <[email protected]>
… tail slice (Slice B4) (#9161) Signed-off-by: LoopX Agent <[email protected]>
…aged-read slice (Slice B5) (#9160) Signed-off-by: LoopX Agent <[email protected]>
…wording (#9162) * docs(release): reconcile final v2.4.0 stabilization PRs and boundary wording Signed-off-by: LoopX Agent <[email protected]> * docs(release): align #9158 and #9161 descriptions with verified commits Signed-off-by: LoopX Agent <[email protected]> --------- Signed-off-by: LoopX Agent <[email protected]>
…d report candidates (#9164) Signed-off-by: LoopX Agent <[email protected]>
…an openings (#9165) Signed-off-by: LoopX Agent <[email protected]>
…t auth (#9167) Signed-off-by: LoopX Agent <[email protected]>
Signed-off-by: LoopX Agent <[email protected]>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent · gpt-6.2-sol · OpenAI (runtime_reported, xhigh)
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机 / Motivation
消费 Turn CLI JSON 的调度器和维护者需要分辨共享运行时给出的结构化拒绝。基线可读到失败及原 Turn,但在没有外层 code 时丢失诊断码。候选透传现有的 Effect Runtime 诊断码,并保留原 Turn 身份、journal 观察与副作用未知状态。验证覆盖本地 CLI、合成 Host 和确定性回执故障注入。真实模型、正式安装 Host 与托管检查留在各自的验收范围。 原 Turn 回执合同
改动思路 / Approach
TypeScript 运行时拥有诊断语义,Python 只需在现有失败渲染器保留已有结构化字段。实际主干比较范围是现有失败渲染器和一份测试,执行、扣额与恢复决策继续沿用原路径。 诊断码只有在原有显式 code 缺少有效字符串时补入。原路径已有的收尾、journal 回读与机器异常分层继续适用。
具体改动 / Changes
审查精确 head 8203459f189e835ed5426af9c9229be37e17e85d。GitHub PR 页面仍报告 eb552a8bb0532de117513ee5277a92e74e746309 和 249 个文件。以同次读到的实际 main b3961047f1f4981cc601e6bd06c6f5808fad5c2e 重做 GitHub Compare 及本地三点比较,merge base 为 ab4654b8fca5b2538d42588134b8f8aef4a32fe6,249 个文件中的 247 个已由主干祖先覆盖。实际提案是 2 文件,新增 80 行。 与当前主干比较
- typed-diagnostic 将既有 Effect Runtime 诊断码交给 Turn JSON 渲染。 渲染分支
- original-receipt CLI 遇到结果持久化拒绝时,保留原 resume key、原 journal 读回以及当前执行的未知效果标记。 本地 CLI 回归
- precedence 显式字符串 code 和 payload 优先,普通异常正文及其他诊断属性不会成为机器码。 兼容对照
语义与 CI 对齐
复用已有诊断词表和错误字段。常规成功、权限拒绝、原有状态及重试策略沿用现行协议。
对主干的风险 / Risks
在共同分支基线重放三条回归,均因缺少 error_code 按预期失败。精确候选在错误回读和当前准入的相关单元共 34 项通过,合入本次读取的真实 main 后另 10 项通过。五个补充对照覆盖 transport lock、暂态 IO、启动异常、普通异常、非字符串 code。本地证据保留了未知效果和原 journal 的区别。本地 quick premerge 与 Ruff 通过。 托管检查未查询。
我的整体评价 / Verdict
APPROVE。 结构化诊断现由已有失败边界完整传递,原 Turn 回读语义保持一致。主干集成和负例支持本次精确提交的评审结论。原评审绑定旧提交,本结论来自当前提交的独立复验。
English verdict: APPROVE at 8203459. The real CLI retains the existing typed diagnostic without changing original-Turn readback or effect authority. The current main comparison independently confirms the two candidate files.
When the managed runtime rejects a Turn result, it returns a typed
diagnostic_code. The Turn CLI previously read only the exception’scode, so a refusal such asgoal_stoppedlost its machine-readableerror_codeeven though the failure and original Turn identity were retained.Reuse the runtime exception’s existing diagnostic in the shared Turn error renderer when no explicit code exists. Existing exception codes/payloads keep precedence; generic error messages do not become machine codes. This changes presentation only and adds no authority or retry policy. The adjacent owner needs no extraction or new abstraction.
Validation: 12 targeted tests passed, including the ordinary
turn run-onceCLI with a synthetic Codex executable and a runtime conflict injected at result persistence, plus existing native Stop controls. The three new conflict cases fail against the base renderer and pass with this change. Ruff and diff whitespace checks pass. The fixture proves the CLI error path, not a real model or installed client.Environment limitation: a fresh
uv sync --extra testfailed with ENOSPC. Tests and Ruff used an existing compatible test environment with the new checkout’s import provenance explicitly verified. No merge or installed-runtime qualification is claimed.